package com.xjcs.saplingplan

import android.app.Application
import com.tencent.tauth.Tencent
import com.umeng.commonsdk.UMConfigure
import com.xjcs.saplingplan.const.AppConfigConst
import com.xjcs.saplingplan.datastore.DataStoreUtils
import com.xjcs.saplingplan.utils.ThirdPartyUtils

class MainApp: Application() {

    companion object{
        private lateinit var context: MainApp

        fun getAppContext(): MainApp{
            return context
        }
    }

    override fun onCreate() {
        super.onCreate()
        context = this
        DataStoreUtils.init(this)
        UMConfigure.preInit(this, AppConfigConst.UM_APP_KEY, BuildConfig.FLAVOR)
        //腾讯QQ授权
        Tencent.setIsPermissionGranted(true)
        ThirdPartyUtils.init(this)
    }

}